<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<%  
 	Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

    Connection con;

    con = DriverManager.getConnection("jdbc:sqlserver://localhost:1510;databaseName=clientes","sa","cenec");

    String nombre= request.getParameter("nombre");
    
    String email= request.getParameter("email");
    
    String sitioweb= request.getParameter("sitioweb");
    
    String query ="insert into clientes values(?,?,?)";
    
    PreparedStatement pst = con.prepareStatement(query);
    
    pst.setString(1, nombre);
    
    pst.setString(2, email);
    
    pst.setString(3, sitioweb);
    
    pst.executeUpdate();
    
    response.sendRedirect("clientesObj.jsp");
    
    
    %>
</body>
</html>